package v2.parser


import load.Saver
import v2.parser.tree.{TypedTree,Navigation}

/**
 * @author bweber
 * @version $Rev$, $Date$
 */



object NavigationMain extends Application {
  
  def info(nav:Navigation) {
    println(nav.pwd)
    println(nav.ls)
    println(nav.current_type)
  }
  
  Type("str")
  Type("person",Attr("first name",Type.typeRef("str")),Attr("last name",Type.typeRef("str")))
  
  val tree = TypedTree("root",Type.listTypes)
  val nav = Navigation(tree)
  info(nav)
  nav.relative_cd("person")
  info(nav)
  nav.relative_cd("first name")
  info(nav)
  nav.up_cd
  info(nav)
  nav.root_cd
  info(nav)
  nav.absolute_cd("root","person","last name")
  info(nav)
  
  Saver(nav)
}